/*
 * @Author: your name
 * @Date: 2021-11-13 08:02:53
 * @LastEditTime: 2022-01-14 19:58:06
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\admin\src\article\index.js
 */
import request from "../../utils/request";
//获取文章数据列表
function getArticle(data) {
    return request({
        url: "/article",
        method: "post",
        data: data,
    });
}
//获取文章数据个数
function getArticleTotal() {
    return request({
        url: "/article",
        method: "get",
    });
}
//获取最新文章
function getNewArticle() {
    return request({
        url: "/article/new",
        method: "post",
    });
}
//获取文章详情
function getDetail(id) {
    return request({
        url: `/article/${id}`,
        method: "get",
    });
}
//编辑文章
function editDetail(data) {
    return request({
        url: "/article",
        method: "put",
        data,
    });
}
//新增文章
function addArticle(data) {
    return request({
        url: "/add/article",
        method: "post",
        data,
    });
}
//删除(单个)
function delArticle(data) {
    return request({
        url: "/article",
        method: "delete",
        data: data,
    });
}
//改变首焦状态
function changeArticleFocus(data) {
    return request({
        url: "/articleFocus",
        method: "put",
        data: data,
    });
}
//批量删除
function batchDelArticle(data) {
    return request({
        url: "/batchArticle",
        method: "delete",
        data: data,
    });
}
//批量发布
function batchPubArticle(data) {
    return request({
        url: "/batchPubArticle",
        method: "put",
        data: data,
    });
}
//批量草稿
function batchDftArticle(data) {
    return request({
        url: "/batchDftArticle",
        method: "put",
        data: data,
    });
}
//批量撤销
function batchRemoveArticle(data) {
    return request({
        url: "/batchRemoveArticle",
        method: "put",
        data: data,
    });
}
//批量首焦
function batchFocusArticle(data) {
    return request({
        url: "/batchFocusArticle",
        method: "put",
        data: data,
    });
}
export default {
    getArticle,
    getArticleTotal,
    getDetail,
    editDetail,
    addArticle,
    getNewArticle,
    delArticle,
    batchDelArticle,
    changeArticleFocus,
    batchPubArticle,
    batchDftArticle,
    batchRemoveArticle,
    batchFocusArticle,
};